<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>资源申请</title>
	<%@ include file="/WEB-INF/include/include.jsp" %>
	<script type="text/javascript" src="<%=path %>/js/rms/resapply/resapplyEdit.js"></script>
  </head>
  <body>
	<div class="editpage-locked-content">
		<h2 class="editpage-lk-title" >查看:<script type="text/javascript">document.write(ResApplyEdit.objName)</script></h2>		
		<div class="editpage-lk-tbar" id="tbarWrap"></div>
	</div>
	<div class="editpage-content" >
		<div class="editpage-form" id="formWrap"></div>
		<div id="hostGridWrap"></div>
		<div id="auditLogGridWrap"></div>
		
	</div>
	
  </body>
</html>

	<ui:page>
	
	<ui:toolbar  id="toolbar"  renderTo="tbarWrap" >
		<x:items>		
			<ui:button text="取消" iconCls='icon-cancel' handler="ResApplyEdit.close" scope="ResApplyEdit" />
			<x:value>-</x:value>
		</x:items>
	</ui:toolbar>

	<ui:formPanel id="resApplyForm" width="700" renderTo="formWrap">
		<x:attr name="border" type="int" >0</x:attr>
		<x:attr name="bodyPadding"  type="int" >5</x:attr>
		<x:attr name="fieldDefaults">
			<x:value>
				<x:attr name="labelAlign"  type="string" >right</x:attr>
			</x:value>
		</x:attr>
		<x:items>
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.text  id="resName" fieldLabel="项目名称" allowBlank="false" readOnly="true" width="510" config="true"   />
				</x:attr>
			</x:value>	
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.text  id="eName" fieldLabel="英文名称" allowBlank="false" readOnly="true" config="true"   />
				</x:attr>
			</x:value>			
			
			
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.date id="startDate"  fieldLabel="开始时间" allowBlank="false" readOnly="true" config="true" ></ui:formPanel.date>
					<ui:formPanel.date id="endDate" fieldLabel="结束时间" allowBlank="false" readOnly="true" config="true" ></ui:formPanel.date>
					<ui:button text="查看该时段资源使用情况" handler="ResApplyEdit.queryRes" ></ui:button>
				
				</x:attr>
			</x:value>
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.textarea id="resDesc" fieldLabel="项目描述" readOnly="true" config="true" width="510"  />		
					<ui:formPanel.hidden id="applyId" config="true" />
					<ui:formPanel.hidden id="authorId" config="true" />
					
				</x:attr>
			</x:value>
		</x:items>
	</ui:formPanel>

  	<ui:model name="GridHostConfigModel">
  		 <x:attr name="fields" type="array">
  			<ui:model.field name="configId"   ></ui:model.field>
  			<ui:model.field name="applyId"   ></ui:model.field>
  			<ui:model.field name="hostDesc"   ></ui:model.field>
  			<ui:model.field name="opsSeries"   ></ui:model.field>
  			<ui:model.field name="opsName"   ></ui:model.field>
  			<ui:model.field name="cups"   ></ui:model.field>
  			<ui:model.field name="memory"   ></ui:model.field>
  			<ui:model.field name="memoryunit"   ></ui:model.field>
  			<ui:model.field name="storage"   ></ui:model.field>
  			<ui:model.field name="storageunit"   ></ui:model.field>
  			<ui:model.field name="netcards"   ></ui:model.field>
  		</x:attr>
  	</ui:model>
	

	
	<ui:grid id="hostConfigGrid" model="GridHostConfigModel" datasetName="ResApplyDataSetHandler" showCheckbox="true" showPaging="false"
		handlerName="ResApplyQueryHandler" autoLoad="false" title="申请主机列表"
		renderTo="hostGridWrap"	>
		<x:columns>
			<ui:gridcolumn dataIndex="configId" hidden="true" ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="applyId" hidden="true" ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="opsName"  text="操作系统" renderer="ResApplyEdit.renderGrid"></ui:gridcolumn>
			<ui:gridcolumn dataIndex="cups" text="CPU个数"  ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="memory" text="内存大小"  renderer="ResApplyEdit.renderGrid"></ui:gridcolumn>
			<ui:gridcolumn dataIndex="storage"  text="硬盘大小" renderer="ResApplyEdit.renderGrid"></ui:gridcolumn>
			<ui:gridcolumn dataIndex="netcards"  text="网卡个数" ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="hostDesc"  text="描述" ></ui:gridcolumn>
		</x:columns>
	</ui:grid>
	  
	  
  	<ui:model name="GridAuditLogModel">
  		 <x:attr name="fields" type="array">
  			<ui:model.field name="stepName"   ></ui:model.field>
  			<ui:model.field name="user_name"   ></ui:model.field>
  			<ui:model.field name="endTime"   ></ui:model.field>
  			<ui:model.field name="opinion"   ></ui:model.field>
  			<ui:model.field name="result"   ></ui:model.field>
  		</x:attr>
  	</ui:model>	
	<ui:grid id="auditLogGrid" model="GridAuditLogModel" title="审批记录"
		datasetName="ResApplyDataSetHandler" showPaging="false" autoLoad="false"
		handlerMethod="queryAudtiLogGrid"
		handlerName="ResApplyQueryHandler"  
		renderTo="auditLogGridWrap"	>
		<x:columns>
			<ui:gridcolumn dataIndex="stepName"  text="审批步骤" ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="user_name" text="审批人"  ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="endTime" text="审批时间" width="130"  ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="opinion"  text="审批意见" width="200" ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="result"  text="审批结果" renderer="ResApplyEdit.renderAuditGrid" ></ui:gridcolumn>
		</x:columns>
	</ui:grid>	
	
	<ui:window id="resqueyWin" width="820" height="500" title="资源使用情况" >
		<x:attr name="layout" type="string">border</x:attr>
		<x:attr name="closeAction">hide</x:attr>
		<x:items>
			<ui:panel id="gttform" >
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="bodyPadding"  type="int" >5</x:attr>
				<x:attr name="html" type="html"><iframe id="framegtt" src="" style="width:810px;height:450px"  />   </x:attr>
			</ui:panel>	
		</x:items>
	</ui:window>
	
	
	<x:bottomScript>
		ResApplyEdit.loadForm();
		ResApplyEdit.loadAuditLog();
	</x:bottomScript>
	
	
	</ui:page>

	
